<div class="bg-light lter b-b wrapper-sm">
    <h1 class="m-n font-thin h4">用户管理</h1>
</div>
<div class="wrapper-sm" ng-controller="userManagentController">
    <div class="panel panel-default">
        <div class="panel-heading font-bold">查询</div>
        <div class="panel-body">
            <label class="control-label pull-left m-t-xs">用户名</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" id="user_name" ng-model="queryTerms.userName" placeholder="请输入用户名">
            </div>
            <label class="control-label pull-left m-t-xs">是否启用</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.isEnabled">
                    <option value="">全部</option>
                    <option value="true">是</option>
                    <option value="false">否</option>
                </select>
            </div>
            <label class="control-label pull-left m-t-xs">手机号</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" id="phone_number" name="phone-number" ng-model="queryTerms.phoneNumber" placeholder="请输入手机号">
            </div>
            <label class="control-label pull-left m-t-xs">所属用户组</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" ng-model="queryTerms.userGroupId" ng-options="x.id as x.name for x in userGroupList">
                    <option value="">全部</option>
                </select>
            </div>
            <button ng-click="query()" class="btn btn-sm btn-default btn-addon" ng-class="{'disabled':querying}" ng-disabled="querying">
                <i class="fa fa-search" ng-show="!querying"></i>
                <i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
                <span ng-show="!querying">查询</span>
                <span ng-show="querying">查询中...</span>
            </button>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            用户列表
        </div>
        <div class="table-responsive">
            <div ui-grid="gridOptions" ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style="height:{{heightA}}px; min-height:395px; overflow:hidden; min-width:1000px;">
                <div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
            </div>
        </div>
        <!-- <div class="panel-body">
            <button class="pull-right-xs btn btn-sm m-b-xs btn-info btn-addon " ng-click="addUser()" data-toggle="modal" data-target="#myModal"><i class="fa fa-plus"></i>添加</button>
        </div> -->
    </div>

    <!-- Modal -->
    <div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">{{title}}</h4>
                </div>
                <form name="userForm" class="form-validation form-horizontal" id="userForm" novalidate>
                        <!-- novalidate -->
                    <div class="modal-body">
                        <div class="form-group">
                            <label class="col-lg-4 control-label">用户名<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" ng-model="detail.userNameBox" placeholder="请填写用户名" name="userNameBox" id="userNameBox" disabled="disabled" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">邮箱 <span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input type="email" id="detail_email" class="form-control" ng-model="detail.email" placeholder="请填写邮箱" name="email" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">手机号<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input type="tel" class="form-control" ng-model="detail.phoneNumberBox" placeholder="请填写手机号" name="phoneNumberBox" id="phoneNumberBox" ng-pattern="/^1\d{10}$/" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">密码<span class="text-danger" ng-show="show">*</span></label>
                            <div class="col-lg-4">
                                <input type="password" class="form-control" id="detail.password" ng-model="detail.password" placeholder="请填写密码" name="password" id="password" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">{{passwordName}}<span class="text-danger" ng-show="show">*</span></label>
                            <div class="col-lg-4">
                                <input type="password" class="form-control"  ng-model="detail.rePassword" placeholder="请再次填写密码" name="rePassword" id="rePassword" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">用户组<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <select class="form-control" ng-change="detail.userGroupSelected()" ng-model="detail.userGroupId" ng-options="x.id as x.name for x in userGroupList2" name="userGroupId" >
                                    <option value="">请选择</option>
                                </select>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-4 control-label">是否启用</label>
                            <div class="col-lg-4">
                                <label class="checkbox i-checks">
                                    <input type="checkbox" class="" checked ng-model="detail.isEnabledBox" name="isEnabledBox" id="isEnabledBox"><i></i> 启用
                                </label>
                            </div>
                        </div>
                        <!-- <div class="form-group">
                            <tms-authorization authority-List="detail.roles"></tms-authorization>
                        </div> -->
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal" id="cancel">取消</button>
                        <button type="button" class="btn btn-primary" ng-click="detail.click()" id="save">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- 添加/编辑权限对话框 -->
    <div class="modal fade bs-example-modal-lg" id="authModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button id="table_employeeManagent_detail_close" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

                    <button type="button" id="table_employeeManagent_expandAll" class="btn btn-primary" ng-click="toggleTree()">
                        <span ng-if="!treeExpand">全部展开</span><span  ng-if="treeExpand">全部折叠</span>
                    </button>

                    <!-- <span>&nbsp;&nbsp;&nbsp;{{UserName}}权限</span> -->

                </div>
                <form class="form-horizontal form-validation" id="employeeForm" novalidate>
                    <div class="modal-body">
                        <div class="form-group">
                            <!-- <tms-commissioner type-List="detail.types"></tms-commissioner> -->
                            <tms-auth-tree auth-tree="authTree" tree-expand="treeExpand" auth-numbers="authNumbers" save-checked="saveChecked" sec-auth-type-tag="secAuthTypeTag"></tms-uth-tree>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" id="table_employeeManagent_detail_cancel" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" id="table_employeeManagent_detail_click" class="btn btn-primary" ng-click="saveCheckedAuth()">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>